<!--
  ~ Electronic Logistics Management Information System (eLMIS) is a supply chain management system for health commodities in a developing country setting.
  ~
  ~ Copyright (C) 2015  John Snow, Inc (JSI). This program was produced for the U.S. Agency for International Development (USAID). It was prepared under the USAID | DELIVER PROJECT, Task Order 4.
  ~
  ~ This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
  ~
  ~ This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Affero General Public License for more details.
  ~
  ~ You should have received a copy of the GNU Affero General Public License along with this program.  If not, see <http://www.gnu.org/licenses/>.
  -->

<div class="alert alert-success" id="saveSuccessMsgDiv" ng-bind="message" ng-show="message"/>

<div class="container-fluid">

    <div >
        <h2 openlmis-message="label.seasonalityRationingAdjustmentType.header"></h2>
    </div>


        <a href="#create" id="country-add-new"
           class="pull-right btn btn-primary"
           ng-disabled="AddEditMode"
           openlmis-message="button.vaccine.addNew" ></a>
    </h2>

    <input id="searchSeasonalRationingType" class="search-query input-xxlarge" type="text" ng-model="query"
           ng-keyup="showSeasonalityRationingTypeSearch()" openlmis-message="placeholder.search"/>

    <div class="form-tip" openlmis-message="search.threeCharacters"></div>
    <div class="facility-list" ng-show="query.length > 2">
        <div ng-switch on="resultCount">
            <h3 ng-switch-when="0" openlmis-message="msg.no.matches|query"></h3>

            <h3 ng-switch-when="1" openlmis-message="msg.one.match|query"></h3>

            <h3 ng-switch-default openlmis-message="msg.many.matches|resultCount|query"></h3>
        </div>
        <a class="close-btn" href="" ng-click="clearSearch()" tabindex="-1"></a>
        <ul id="seasonalRationingList" class="user-list" ng-model="filteredStorageTypes">
            <li ng-repeat="c in filteredSeasonalityRationingTypes" >
                <a id="st{{$index}}" href=""   ng-click="editCountries(c.id)">
                    <span class="user-name">{{c.name}}</span>

                </a>

                <div class="user-actions">


                    <a id="editStorageType{{$index}}" href="" class="btn btn-primary btn-small" openlmis-message="button.edit"
                       ng-click="editStorageType(c.id)"></a>
                    <a id="showDeleteConfirmDialog{{$index}}" href="" ng-click="showDeleteConfirmDialog(c)" class="btn btn-primary btn-small" openlmis-message="button.delete"></a>

                </div>
            </li>
        </ul>
    </div>

    <div class="content-body" ng-hide="query.length > 2">

        <table class="table table-bordered" ng-show="data == undefined || data.length == 0">
            <tr>
                <td openlmis-message="message.vaccine.noDataToshowInDatatable"></td>
            </tr>
        </table>
        <table class="table table-striped table-bordered" ng-table="tableParams" >
            <thead>
            <tr class="gradient-header">
                <!--<th data-title="'Name'" style="width:20px" sortable="name" openlmis-message="label.seasonalityRationingAdjustmentType.name">-->
                <!--</th>-->
                <th openlmis-message="label.seasonalityRationingAdjustmentType.name">
                </th>
                <th openlmis-message="label.seasonalityRationingAdjustmentType.description">
                </th>
                <th openlmis-message="label.seasonalityRationingAdjustmentType.displayOrder">
                </th>
                <th openlmis-message="label.vaccine.countries.action">
                </th>
            </tr>
            </thead>
            <tbody>
            <tr ng-repeat="sr in seasonalityRationings">
                <td data-title="'Name'" style="width:20px" sortable="name">
                    <div>{{sr.name}}</div>
                </td>
                <td data-title="'Long Name'" style="width:100px">
                    <div>{{sr.description}}</div>
                </td>
                <td data-title="'ISO Code2'" style="width:100px">
                <div>{{sr.displayOrder}}</div>
            </td>

                <td data-title="'Action'" style="width:100px">
                    <a href="" ng-click="editSeaonalityRationingTypes(sr.id)" openlmis-message="button.edit"></a>|
                    <a id="showDeleteConfirmDialog1{{$index}}" href="" ng-click="showDeleteConfirmDialog(sr)" openlmis-message="button.delete"></a>
                </td>



            </tr>
            </tbody>
        </table>
    </div>


</div>


